package com.itheima.mapper;

import com.itheima.pojo.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Insert("insert into student (name, number, gender, phone, education_id, class_id, " +
            "update_time, discipline_count, discipline_score) values (#{name}, #{number}, #{gender}," +
            "#{phone}, #{educationId}, #{classId}, #{updateTime}, #{disciplineCount}, #{disciplineScore})")
    void insertStudent(Student student);

    void deleteByIds(String[] ids);

    List<Student> list(String name, String educationId, String number, String classId);

    void updateStudent(Student student);
    @Select("select * from student where id = #{id}")
    Student getStudentById(Integer id);
}
